// 类似于计算属性
const getters = {
  // sidebar: state => state.app.sidebar,
  powerCounter(state){
    return state.test.counter * state.test.counter
  },
  more20stu(state){
    return state.test.students.filter(s => s.age > 20)
  },
  // 可以接收两个参数 state,getters
  more20stuLength(state,getters){
    return getters.more20stu.length
  },
  // 返回一个函数
  moreAgeStu(state){
    return function(age){
      return state.test.students.filter(s => s.age > age)
    }
  }
}
export default getters
